package org.aldar.bquest.entity;

import android.app.Activity;
import org.aldar.bquest.util.ExceptionUtil;
import org.aldar.bquest.util.Logger;
import org.aldar.bquest.util.SQLiteHelper;
import org.andengine.engine.camera.Camera;
import org.andengine.entity.scene.Scene;
import org.andengine.input.touch.TouchEvent;
import org.andengine.opengl.util.GLState;

/**
 * User: Daria
 * Date: 6/21/14 11:38 PM
 */
public class LoggedScene extends Scene {

    private SQLiteHelper sqLiteHelper;

    private Activity context;

    private static final Logger LOG = new Logger(LoggedScene.class);

    public LoggedScene(Activity context) {
        this.sqLiteHelper = new SQLiteHelper(context);
        this.context = context;
    }

    @Override
    protected void onManagedUpdate(float pSecondsElapsed) {
        try {
            super.onManagedUpdate(pSecondsElapsed);    //To change body of overridden methods use File | Settings | File Templates.
        } catch (Throwable t) {
            ExceptionUtil.logThrowable(t, context, sqLiteHelper);
        }
    }

    @Override
    protected void onManagedDraw(GLState pGLState, Camera pCamera) {
        try {
            super.onManagedDraw(pGLState, pCamera);    //To change body of overridden methods use File | Settings | File Templates.
        } catch (Throwable t) {
            ExceptionUtil.logThrowable(t, context, sqLiteHelper);
        }
    }

    @Override
    public boolean onSceneTouchEvent(TouchEvent pSceneTouchEvent) {
        try {
            return super.onSceneTouchEvent(pSceneTouchEvent);    //To change body of overridden methods use File | Settings | File Templates.
        } catch (Throwable t) {
            ExceptionUtil.logThrowable(t, context, sqLiteHelper);
        }
        return false;
    }

}
